/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */
import isObject from 'lodash/isObject';
import { mode_name } from './index.config';

export function formatDetailVal(data: any, key: string) {
  if (data && key && isObject(data)) {
    if (isObject(data[key])) {
      if (key == 'shunfen') {
        return mode_name[data[key].type] || '-';
      }
    } else {
      return data[key] || '-';
    }
  }
  return '-';
}
